package com.tour.service;

import com.github.pagehelper.PageInfo;
import com.tour.common.ServerResponse;
import com.tour.pojo.EasyUIDataGridResult;
import com.tour.pojo.User;

/**
 * Created by tang
 */
public interface IUserService {

	/**
	 * 用户登录
	 * @param username
	 * @param password
	 * @return
	 */
    ServerResponse<User> login(String username, String password);

    /**
     * 用户注册
     * @param user
     * @return
     */
    ServerResponse<String> register(User user,String validCode);
    
    /**
     * 发送短信验证码
     * @param phoneNo
     * @return
     */
    String sendCheckMes(String phoneNo);

    /**
     * 验证信息是否正确
     * @param validCode
     * @return
     */
    ServerResponse<String> checkMes(String validCode);
    
    /**
     * 验证用户昵称
     * @param phone
     * @return
     */
    ServerResponse<String> checkUsername(String username);
    
    /**
     * 验证手机号码是否正确
     * @param phone
     * @return
     */
    ServerResponse<String> checkPhone(String phone);
    
    ServerResponse<String> checkValid(String str,String type);

    ServerResponse selectQuestion(String username);

    ServerResponse<String> checkAnswer(String username,String question,String answer);

    /**
     * 忘记密码
     * @param username
     * @param passwordNew
     * @param forgetToken
     * @return
     */
    ServerResponse<String> forgetResetPassword(String phone,String passwordNew,String validcode);

    /**
     * 验证旧密码
     * @param passwordOld
     * @param user
     * @return
     */
    ServerResponse<String> checkPassword(String passwordOld,User user);
    
    /**
     *修改密码 
     * @param passwordNew
     * @param user
     * @return
     */
    ServerResponse<String> resetPassword(String passwordNew,User user);

    ServerResponse<User> updateInformation(User user);

    ServerResponse<User> getInformation(Integer userId);

    ServerResponse checkAdminRole(User user);
    
   EasyUIDataGridResult getUserList(int pageNum, int pageSize);
    
    ServerResponse setStatus(Integer id, Boolean status);
}
